Ext.define('carManage.view.carInfo.EditOrAddForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.editOrAddForm',
    labelWidth: 80,
    width: '100%',
    height: '100%',
    bodyStyle: 'padding: 4px',
    border: false,
    autoscroll: true,
    frame: true,
    autoScroll: true,
    items: [{
            xtype: 'container',
            anchor: '100%',
            layout: 'hbox',
            items: [{
                    xtype: 'container',
                    flex: 1,
                    layout: 'anchor',
                    items: [
                        {
                            xtype: 'hidden',
                            name: 'id'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '车牌号码',
                            emptyText: '车牌号码(必填)',
                            allowBlank: false,
                            name: 'code',
                            anchor: '95%'
                        }, {
                            xtype: 'combo',
                            fieldLabel: '资产属性',
                            hiddenName: 'attributes',
                            store: 'ZiChanStore',
                            displayField: 'name',
                            valueField: 'name',
                            triggerAction: 'all',
                            emptyText: '---请选择---',
                            allowBlank: false,
                            anchor: "95%",
                            name: 'attributes'
                        }, {
                            xtype: 'combo',
                            fieldLabel: '产权单位名称',
                            hiddenName: 'company',
                            store: 'CompanyStore',
                            displayField: 'name',
                            valueField: 'name',
                            typeAhead: true,
                            triggerAction: 'all',
                            emptyText: '---请选择---',
                            allowBlank: false,
                            anchor: "95%",
                            name: 'company'
                        },
                        {
                            xtype: 'combo',
                            fieldLabel: '使用部门名称',
                            hiddenName: 'department',
                            store: 'DepartmentStore',
                            displayField: 'name',
                            valueField: 'name',
                            typeAhead: true,
                            triggerAction: 'all',
                            emptyText: '---请选择---',
                            allowBlank: false,
                            anchor: "95%",
                            name: 'department'
                        }, {
                            xtype: 'combo',
                            fieldLabel: '车辆类型',
                            hiddenName: 'type',
                            store: 'CarTypeStore',
                            displayField: 'name',
                            valueField: 'name',
                            typeAhead: true,
                            triggerAction: 'all',
                            emptyText: '---请选择---',
                            allowBlank: false,
                            anchor: "95%",
                            name: 'type'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '车辆原值',
                            emptyText: '车辆原值(万)(必填)',
                            allowBlank: false,
                            name: 'price',
                            anchor: '95%'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '制作厂商',
                            emptyText: '制作厂商(必填)',
                            allowBlank: false,
                            name: 'manufacturer',
                            anchor: '95%'
                        }
                    ]
                }, {
                    xtype: 'container',
                    flex: 1,
                    layout: 'anchor',
                    items: [
                        {
                            xtype: 'textfield',
                            fieldLabel: '驾驶员姓名',
                            emptyText: '驾驶员姓名',
                            name: 'driver',
                            anchor: '95%'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '品牌',
                            emptyText: '品牌(必填)',
                            allowBlank: false,
                            name: 'brand',
                            anchor: '95%'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '排量',
                            emptyText: '排量(必填)',
                            allowBlank: false,
                            name: 'displacement',
                            anchor: '95%'
                        }, {
                            xtype: "radiogroup",
                            fieldLabel: "使用公司标识",
                            disabled: false,
                            name: 'logo',
                            anchor: "95%",
                            items: [{
                                    boxLabel: '是',
                                    name: 'logo',
                                    inputValue: '1'
                                }, {
                                    boxLabel: '否',
                                    name: 'logo',
                                    inputValue: '2',
                                    checked: true
                                }]
                        }, {
                            xtype: "radiogroup",
                            fieldLabel: "是否安装GPS",
                            disabled: false,
                            name: 'gps',
                            anchor: "95%",
                            items: [{
                                    boxLabel: '是',
                                    name: 'gps',
                                    inputValue: '1'
                                }, {
                                    boxLabel: '否',
                                    name: 'gps',
                                    inputValue: '2',
                                    checked: true
                                }]
                        }, {
                            xtype: "radiogroup",
                            fieldLabel: "状态",
                            disabled: false,
                            anchor: "95%",
                            items: [{
                                    boxLabel: '运行',
                                    name: 'states',
                                    inputValue: '1',
                                    checked: true
                                }, {
                                    boxLabel: '报废',
                                    name: 'states',
                                    inputValue: '2'
                                }, {
                                    boxLabel: '待报废',
                                    name: 'states',
                                    inputValue: '3'
                                }]
                        }, {
                            xtype: 'datefield',
                            fieldLabel: '购车日期',
                            name: 'purchase_date',
                            emptyText: '购车日期(必填)',
                            allowBlank: false,
                            altFormats: 'Ymd',
                            format: 'Y-m-d',
                            dateFormat: 'Ymd',
                            anchor: '95%'
                        }, {
                            xtype: 'datefield',
                            fieldLabel: '使用日期',
                            emptyText: '使用日期(必填)',
                            allowBlank: false,
                            name: 'use_date',
                            altFormats: 'Ymd',
                            format: 'Y-m-d',
                            dateFormat: 'Ymd',
                            anchor: '95%'
                        }
                    ]
                }]
        }],
    initComponent: function() {
        this.callParent(arguments);
    }
});